package practice;

/**
 * User: 86156
 * Date: 2023-04-12
 * Time: 10:34
 */
public class Person {
    private String name;
    private int age;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void KeepPet(Animal a,String something) {
        if (a instanceof Dog) {
            System.out.println("年龄为" + age + "岁的" + name + "养了一只" + a.getColor() + "颜色的" + a.getAge()+ "的狗" +
                    a.getAge() + "的" + a.getColor() + "颜色的狗两只前腿抱住" + something + "猛吃");
        }else{
            System.out.println("年龄为"+age+"岁的"+name+"养了一只"+a.getColor()+"颜色的"+a.getAge()+"的猫"+
                    a.getAge()+"的"+a.getColor()+"颜色的猫两只前腿抱住"+something+"猛吃");
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}
